package itcast.web.servlet;

import itcast.domain.Build;
import itcast.domain.Daka;
import itcast.service.BuildService;
import itcast.service.DakaService;
import itcast.service.impl.BuildServiceImpl;
import itcast.service.impl.DakaServiceImpl;
import org.apache.commons.beanutils.BeanUtils;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Map;

@WebServlet("/studentfind_DakaServlet")
public class Studentfind_DakaServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //获取id
        String id=request.getParameter("id");
        //2.调用Service查询
       DakaService service=new DakaServiceImpl();
      Daka daka=service.studentfinddaka(id);
        //3.将build存入request
        request.setAttribute("daka",daka);

        request.getRequestDispatcher("/xuesheng/dakalist.jsp").forward(request,response);

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        this.doPost(request,response);
    }
}
